CREATE TABLE [dbo].[TDREND_ANUL]
(
[CO_EMPR] [dbo].[TD_VC_002] NOT NULL,
[CO_UNID_CONC] [dbo].[TD_VC_003] NOT NULL,
[NU_REND_GAST] [dbo].[TD_VC_010] NOT NULL,
[FE_REND_GAST] [dbo].[TD_DT_001] NOT NULL,
[NU_CORR_GAST] [dbo].[TD_IN_001] NOT NULL CONSTRAINT [DF__TDREND_AN__NU_CO__4262CC11] DEFAULT ((0)),
[CO_CNTA_EMPR] [dbo].[TD_VC_020] NULL,
[TI_ENTI] [dbo].[TD_VC_001] NULL,
[TI_AUXI_EMPR] [dbo].[TD_VC_001] NULL,
[CO_ENTI] [dbo].[TD_VC_020] NULL,
[DE_ENTI] [dbo].[TD_VC_100] NULL,
[CO_CENT_COST] [dbo].[TD_VC_020] NULL,
[IM_CONV] [dbo].[TD_NU_016_004] NOT NULL CONSTRAINT [DF__TDREND_AN__IM_CO__4356F04A] DEFAULT ((0)),
[CO_TIPO_DOCU] [dbo].[TD_VC_003] NOT NULL,
[NU_DOCU_PROV] [dbo].[TD_VC_020] NOT NULL,
[CO_TIPO_OPER] [dbo].[TD_VC_003] NOT NULL,
[FA_CAMB_DOCU] [dbo].[TD_NU_015_006] NOT NULL CONSTRAINT [DF__TDREND_AN__FA_CA__444B1483] DEFAULT ((1.000)),
[DE_OBSE] [dbo].[TD_VC_100] NULL,
[CO_MONE] [dbo].[TD_VC_003] NOT NULL,
[IM_DOCU] [dbo].[TD_NU_016_004] NOT NULL CONSTRAINT [DF__TDREND_AN__IM_DO__453F38BC] DEFAULT ((0)),
[FE_DOCU] [dbo].[TD_DT_001] NOT NULL,
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TDREND_AN__CO_US__46335CF5] DEFAULT (suser_sname()),
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TDREND_AN__FE_US__4727812E] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TDREND_AN__CO_US__481BA567] DEFAULT (suser_sname()),
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TDREND_AN__FE_US__490FC9A0] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TDREND_ANUL] ADD CONSTRAINT [PK__TDREND_A__AEE35CC3195694DD] PRIMARY KEY CLUSTERED  ([CO_EMPR], [CO_UNID_CONC], [NU_REND_GAST], [FE_REND_GAST], [NU_CORR_GAST]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TDREND_ANUL] ADD CONSTRAINT [FK__TDREND_ANUL__67AA2AB0] FOREIGN KEY ([CO_EMPR], [CO_TIPO_OPER]) REFERENCES [dbo].[TTTIPO_OPER] ([CO_EMPR], [CO_TIPO_OPER])
GO
ALTER TABLE [dbo].[TDREND_ANUL] ADD CONSTRAINT [FK__TDREND_ANUL__689E4EE9] FOREIGN KEY ([CO_EMPR], [CO_UNID_CONC], [NU_REND_GAST], [FE_REND_GAST]) REFERENCES [dbo].[TCREND_ANUL] ([CO_EMPR], [CO_UNID_CONC], [NU_REND_GAST], [FE_REND_GAST])
GO
